package cn.nupt.service;

import cn.nupt.dao.SecondaryCardDAOImpl;

public class SecondaryCardService {
	//增加一张年卡，并返回年卡id
	public int addSecondaryCard(int cardId, int leftTimes){
		SecondaryCardDAOImpl secondaryCardDAOImpl= new SecondaryCardDAOImpl();
		//查找当前表的最大值
		int maxId =secondaryCardDAOImpl.selectMaxCardId();
		maxId++;//最大值加1
		secondaryCardDAOImpl.insertSecondaryCard(cardId, leftTimes);
		return maxId;
	}
}
